/**
 *
 */
package com.cn.qtms.common.result;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.util.HashMap;

/**
 * 查询参数HashMap 封装前端查询参数
 * @author zhangyang
 *
 */
@Getter
@Setter
@NoArgsConstructor
public class QueryParam extends HashMap<String, Object> implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 页码
     */
    private Integer page;
    /**
     * 单页条数
     */
    private Integer size;

    public void addSearch(String key, String value) {
        this.put(key, value);
    }

    public int getCurrentIndex() {
        return (page - 1) * size;
    }

    public void reset() {
        this.clear();
    }

}
